#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <bitset>
#include <utility>
using namespace std;

#define mm(a, n) memset(a, n, sizeof a)
#define mk(a, b) make_pair(a, b)

const double eps = 1e-6;
const int INF = 0x3f3f3f3f;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef pair<LL, LL> PLL;
typedef pair<int, LL> PIL;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

const int N = 110;

struct Num
{
    int num;
    int den;
    bool op; // true:neg;
}num[N];
int n;
LL deno = 1; // deno 存放分母的公约数

LL gcd(LL a, LL b) {
    return b > 0 ? gcd(b, a % b) : a;
}

LL lcm(LL a, LL b) {
    // 如果是LL需要先计算除法
    return a * (b / gcd(a, b));
}

inline void solution() {
    cin >> n;
    for (int i = 0; i < n; i ++ ) {
        LL nu, de;
        scanf("%lld/%lld",&nu, &de);
        if (nu < 0) num[i].op = true, nu = -nu;
        LL g = gcd(nu, de);
        if (g != 1) {
            nu /= g;
            de /= g;
        }
        deno = lcm(deno, de);
        num[i].num = nu;
        num[i].den = de;
    }
    LL numerator = 0;
    for  (int i = 0; i < n; i ++ ) {
        if (!num[i].op) numerator += deno / num[i].den * num[i].num;
        else  numerator -= deno / num[i].den * num[i].num;
    }
    // calc sum;
    LL t = gcd(numerator, deno);
    numerator /= t, deno /= t;
    if (numerator % deno == 0) {
        printf("%lld\n", numerator / deno);
    } else if (numerator / deno == 0){
        printf("%lld/%lld\n", numerator % deno, deno);
    } else {
        printf("%lld %lld/%lld\n", numerator / deno, numerator % deno, deno);
    }
}

int main() {
    freopen("input.txt", "r", stdin);
    quickread();
    solution();
    return 0;
}